package com.ruibang.glass.sale.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 发货申请记录表
 * </p>
 *
 * @author mameng
 * @since 2024-03-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(description = "发货申请记录表")
@TableName(value = "g_sale_shipping_application")
public class SaleShippingApplication extends BaseEntity implements Serializable {

    @ApiModelProperty(value = "记录唯一标识符")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "订单编号")
    private String orderNumber;

    @ApiModelProperty(value = "合同名称")
    private String contractName;

    @ApiModelProperty(value = "合同编号")
    private String contractNumber;

    @ApiModelProperty(value = "产品类型")
    private String productType;

    @ApiModelProperty(value = "发货进度")
    private String shippingProgress;

    @ApiModelProperty(value = "下单时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime orderTime;

    @ApiModelProperty(value = "发货日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime shippingDate;

    @ApiModelProperty(value = "总数")
    private BigDecimal totalQuantity;

    @ApiModelProperty(value = "待发货数量")
    private BigDecimal pendingShipment;

    @ApiModelProperty(value = "已发货总数")
    private BigDecimal shippedQuantity;

    @ApiModelProperty(value = "退货数")
    private BigDecimal returnedQuantity;

    @ApiModelProperty(value = "换货数")
    private BigDecimal exchangedQuantity;

    @ApiModelProperty(value = "取消数")
    private BigDecimal cancelledQuantity;

    @ApiModelProperty(value = "计划发货")
    private BigDecimal planQuantity;

    @ApiModelProperty(value = "完成率")
    private BigDecimal completionRate;

    @ApiModelProperty(value = "审批状态")
    private String approvalStatus;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "发货单号")
    private String deliveryOrderNumber;

    @ApiModelProperty(value = "订货结算客户")
    private String orderingSettlementCustomer;

    @ApiModelProperty(value = "需方客户")
    private String demandCustomer;

    @ApiModelProperty(value = "产品名称")
    private String productName;

    @ApiModelProperty(value = "产品Id")
    private String productId;

    @ApiModelProperty(value = "订单Id")
    private String orderId;

    @ApiModelProperty(value = "合同Id")
    private String contractId;

    @ApiModelProperty(value = "执行标准")
    private String executionStandard;

    @ApiModelProperty(value = "品级")
    private String grade;

    @ApiModelProperty(value = "创建人")
    private String createUserId;

    @ApiModelProperty(value = "出库单号")
    private String outboundNumber;

    @ApiModelProperty(value = "出库用途")
    private String purposeOut;

    @ApiModelProperty(value = "产品规格")
    private String specification;


    @ApiModelProperty(value = "单价（含税）")
    private BigDecimal grossUnitPrice;
    @ApiModelProperty(value = "金额（含税）")
    private BigDecimal grossAmount;
    @ApiModelProperty(value = "单价（未税）")
    private BigDecimal netUnitPrice;
    @ApiModelProperty(value = "金额（未税）")
    private BigDecimal netAmount;
    @ApiModelProperty(value = "其他加价")
    private String otherMarkup;
    @ApiModelProperty(value = "批量优惠价")
    private String bulkDiscountPrice;

    @ApiModelProperty(value = "运输金额")
    private String transportAmount;
    @ApiModelProperty(value = "总额（含税）")
    private BigDecimal totalAmount;
    @ApiModelProperty(value = "总额（未税）")
    private BigDecimal netTotalAmount;
    @ApiModelProperty(value = "税额")
    private BigDecimal taxAmount;


    @TableField(exist = false)
    List<String> coaFileList;

    @ApiModelProperty(value = "状态")
    @TableField(exist = false)
    private String status;

    @ApiModelProperty(value = "流程Id")
    @TableField(exist = false)
    private String processId;

    @ApiModelProperty(value = "审批状态")
    private String approveStatus;

    @ApiModelProperty(value = "审批节点")
    @TableField(exist = false)
    private String nodeName;

    @ApiModelProperty(value = "审批人")
    @TableField(exist = false)
    private String approveUser;

    @ApiModelProperty(value = "审批人")
    @TableField(exist = false)
    private String approveUserId;

    @ApiModelProperty(value = "菜单Id")
    @TableField(exist = false)
    private String menuId;

    @ApiModelProperty(value = "联系人")
    private String contactPerson;

    @ApiModelProperty(value = "联系电话")
    private String contactPhoneNumber;

    @ApiModelProperty(value = "收货地址")
    private String deliveryAddress;

    @ApiModelProperty(value = "是否被关联 1_未关联 2_关联")
    private String collectionStatus;

    @ApiModelProperty(value = "司机及电话")
    private String driverAndPhoneNumber;

    @ApiModelProperty(value = "车牌号")
    private String licensePlateNumber;

    @TableField(exist = false)
    private List<SalesShippingItems> salesShippingItemsList;

    @ApiModelProperty(value = "物流单号")
    private String logisticsNumber;

    @ApiModelProperty(value = "发货方式")
    private String logisticsMethod;

    @ApiModelProperty(value = "退换货ID")
    private String returnId;

    @ApiModelProperty(value = "物品编号")
    private String productCode;

    @ApiModelProperty(value = "退货类型")
    @TableField(exist = false)
    private String returnType;

    @ApiModelProperty(value = "订货结算客户")
    @TableField(exist = false)
    private String consignorSettlementCustomer;


    @ApiModelProperty(value = "多发货数量")
    @TableField(exist = false)
    private BigDecimal moreQuality;

    @ApiModelProperty(value = "发货状态 1_小于订单数量 2_大于订单数量")
    private String shappingStatus;


}
